package com.tsingteng.cosfun.ui.costar;

import android.app.DownloadManager;

import com.tsingteng.cosfun.bean.CommBean;
import com.tsingteng.cosfun.bean.VideoMusicBean;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.mvp.presenter.BasePresenter;
import com.tsingteng.cosfun.ui.costar.publish.VideoModel;

import java.util.List;

/**
 * 描述 :
 * 创建人: 肖利.
 * 时间:2018/8/27
 * qq(872179966)
 */

public class VideoMusicPresenter extends BasePresenter<VideoMusicContract.IVideoMusicView> implements VideoMusicContract.IVideoMusicPresenter {
    private VideoMusicContract.IVideoMusicView mView;
    private VideoModel model;

    public VideoMusicPresenter() {
        model = new VideoModel();
    }

    @Override
    public void getMusicVideoData(int pageNa, int pageSize) {
        mView = getView();
        RxObserver<CommBean> rxObserver = new RxObserver<CommBean>(this) {
            @Override
            protected void onFaile(int errorCode, String errorMsg) {
                mView.showFail(errorMsg);
            }

            @Override
            protected void onSuccess(CommBean commBean) {
                mView.showMusicData(commBean);
            }
        };
        model.getVideoMusic(String.valueOf(pageNa),String.valueOf(pageSize),rxObserver);
        addDisposable(rxObserver);
    }
}
